package com.example.assistant;

/**
 * RAG 检索模块（简化版）
 */
public class RagRetriever {

    public static String retrieveContext(String intent) {
        switch (intent) {
            case "light":
                return "{ \"device_type\": \"light\", \"properties\": { \"power\": { \"type\": \"switch\", \"values\": [\"on\", \"off\"] }, \"brightness\": { \"type\": \"int\", \"min\": 0, \"max\": 100 } }}";
            case "ac":
                return "{ \"device_type\": \"ac\", \"properties\": { \"power\": { \"type\": \"switch\", \"values\": [\"on\", \"off\"] }, \"temperature\": { \"type\": \"int\", \"min\": 16, \"max\": 30 }, \"mode\": { \"type\": \"enum\", \"values\": [\"cool\", \"heat\", \"fan\", \"dry\"] } }}";
            case "curtain":
                return "{ \"device_type\": \"curtain\", \"properties\": { \"position\": { \"type\": \"int\", \"min\": 0, \"max\": 100 }, \"state\": { \"type\": \"switch\", \"values\": [\"open\", \"close\"] } }}";
            case "tv":
                return "{ \"device_type\": \"tv\", \"properties\": { \"power\": { \"type\": \"switch\", \"values\": [\"on\", \"off\"] }, \"volume\": { \"type\": \"int\", \"min\": 0, \"max\": 100 }, \"channel\": { \"type\": \"int\", \"min\": 1, \"max\": 999 }, \"mute\": { \"type\": \"switch\", \"values\": [\"on\", \"off\"] } }}";
            case "fan":
                return "{ \"device_type\": \"fan\", \"properties\": { \"power\": { \"type\": \"switch\", \"values\": [\"on\", \"off\"] }, \"speed\": { \"type\": \"int\", \"min\": 1, \"max\": 5 }, \"oscillate\": { \"type\": \"switch\", \"values\": [\"on\", \"off\"] } }}";
            case "lock":
                return "{ \"device_type\": \"lock\", \"properties\": { \"locked\": { \"type\": \"switch\", \"values\": [\"on\", \"off\"] }, \"unlock_method\": { \"type\": \"enum\", \"values\": [\"fingerprint\", \"password\", \"keypad\", \"rfid\"] } }}";
            case "humidifier":
                return "{ \"device_type\": \"humidifier\", \"properties\": { \"power\": { \"type\": \"switch\", \"values\": [\"on\", \"off\"] }, \"humidity_level\": { \"type\": \"int\", \"min\": 30, \"max\": 80 }, \"auto_mode\": { \"type\": \"switch\", \"values\": [\"on\", \"off\"] } }}";
            default:
                return "";
        }
    }
}